Skip to content

Conversation

@Emil-Juhl
Copy link

See commits.

Submitted for upstream: zephyrproject-rtos#81497

@Emil-Juhl
Copy link
Author

Since we are far far behind upstream main, the first commit didn't cherry-pick cleanly. But this is merely due to formatting.

DmtKats
DmtKats previously approved these changes Nov 18, 2024
Copy link

@DmtKats DmtKats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets wait a bit for the upstream review. If you really need this now we can just merge

@Emil-Juhl
Copy link
Author

Upstream merged with minor changes - I think I'll just backport the relevant patches; maybe including the older stuff that reformatted code etc.

Emil Dahl Juhl added 7 commits December 3, 2024 08:20
This reverts commit 9aecff9.

We ought to replace this bespoke patch with a direct cherry-pick from
upstream main
This reverts commit d3b74c3.

We ought to replace this bespoke patch with a direct cherry-pick from
upstream main
The lp5569 controller contains an internal charge pump which can be useful
for driving LEDs with a forward voltage greater than the lp5569 supply.
Taking advantage of the charge pump can alleviate the need for an external
boost converter.

Add a dts property, charge-pump-mode, to the ti,lp5569 binding with which
the cp_mode bits of the MISC register will be configured.

Following the datasheet, the possible configurations are:
    0x00 -> disabled (default)
    0x01 -> 1x mode
    0x10 -> 1.5x mode
    0x11 -> auto mode

Signed-off-by: Emil Juhl <[email protected]>
(cherry picked from commit 47f9040)
The lp5569 features a double functioning pin for enable and pwm control.
The chip, however, uses the first rising edge to initialize and get ready
for i2c communication, and then the pin alters function to pwm mode.

Add support for providing enable-gpios to the lp5569 in the dts, which
will make sure to assert the pin and wait for the chip to initialize
before attempting further configuration of the chip.

Signed-off-by: Emil Juhl <[email protected]>
(cherry picked from commit f53a401)
Run clang-format on drivers/led/lp5569.c to align formatting in the file.

No functional changes intended.

Signed-off-by: Emil Dahl Juhl <[email protected]>
(cherry picked from commit bc5477a)
The lp5569 controller supports auto-increment for its registers. This is by
default enabled in the chip, but the driver actively disabled it.

Since auto-increment is useful for writing multiple consecutive registers,
enable the feature. The driver, however, doesn't perform such consecutive
writes and thus the existing behavior is not altered.

Signed-off-by: Emil Dahl Juhl <[email protected]>
(cherry picked from commit 45744b4)
The lp5569 has multiple pwm outputs, and thus implementing the
write_channels api to set multiple values in a single call makes sense.

Implement the write_channels function with a basic range check on the
channel range.
Since the lp5569 supports auto-increment, all of the channels can be
written in one i2c transfer, starting from the pwm register of the
start_channel.

Signed-off-by: Emil Dahl Juhl <[email protected]>
(cherry picked from commit d6ac9e8)
@Emil-Juhl Emil-Juhl force-pushed the emdj/beo/add-lp5569-write-channels branch from dfa70ba to 3da5718 Compare December 3, 2024 07:24
@Emil-Juhl Emil-Juhl requested a review from DmtKats December 3, 2024 07:24
@Emil-Juhl
Copy link
Author

@dkarnikis @DmtKats I now reverted our two bespoke patches for the lp5569 and cherry-picked the entire range of patches from upstream (up until the point of lp5569 write_channels).

@Emil-Juhl Emil-Juhl merged commit 3197b35 into beo/3.5.99 Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants